Skip to content

feat(linter): support disable directives for type aware rules#14052

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/09-23-feat_linter_support_disable_directives_for_type_aware_rules
Oct 6, 2025
Merged

feat(linter): support disable directives for type aware rules#14052
graphite-app[bot] merged 1 commit intomainfrom
c/09-23-feat_linter_support_disable_directives_for_type_aware_rules

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Sep 23, 2025

fixes #13491

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-editor Area - Editor and Language Server labels Sep 23, 2025
Copy link
Contributor Author

camc314 commented Sep 23, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added the C-enhancement Category - New feature or request label Sep 23, 2025
@camc314 camc314 self-assigned this Sep 23, 2025
@camc314 camc314 force-pushed the c/09-23-refactor_linter_introduce_lintrunner_ branch from f67a39e to b093549 Compare September 23, 2025 15:12
@camc314 camc314 force-pushed the c/09-23-feat_linter_support_disable_directives_for_type_aware_rules branch from 41ea359 to d63f550 Compare September 23, 2025 15:12
@codspeed-hq
Copy link

codspeed-hq bot commented Sep 23, 2025

CodSpeed Performance Report

Merging #14052 will not alter performance

Comparing c/09-23-feat_linter_support_disable_directives_for_type_aware_rules (d16df93) with main (f88f5f4)1

Summary

✅ 4 untouched
⏩ 33 skipped2

Footnotes

  1. No successful run was found on main (fa3712d) during the generation of this report, so f88f5f4 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 33 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@graphite-app graphite-app bot force-pushed the c/09-23-refactor_linter_introduce_lintrunner_ branch 2 times, most recently from 42e96b5 to f9fbad1 Compare September 24, 2025 12:06
@camc314 camc314 force-pushed the c/09-23-refactor_linter_introduce_lintrunner_ branch from f9fbad1 to 6602e89 Compare September 25, 2025 12:40
@camc314 camc314 force-pushed the c/09-23-feat_linter_support_disable_directives_for_type_aware_rules branch from d63f550 to 9222f33 Compare September 25, 2025 12:40
@camc314 camc314 force-pushed the c/09-23-refactor_linter_introduce_lintrunner_ branch from 6602e89 to 0a2a774 Compare September 25, 2025 13:43
@camc314 camc314 force-pushed the c/09-23-feat_linter_support_disable_directives_for_type_aware_rules branch from 9222f33 to f009d6f Compare September 25, 2025 13:43
@camc314 camc314 force-pushed the c/09-23-refactor_linter_introduce_lintrunner_ branch 3 times, most recently from 4196bea to 78b185a Compare October 2, 2025 09:08
@camc314 camc314 force-pushed the c/09-23-feat_linter_support_disable_directives_for_type_aware_rules branch from f009d6f to ba4fd63 Compare October 2, 2025 09:09
@graphite-app graphite-app bot changed the base branch from c/09-23-refactor_linter_introduce_lintrunner_ to graphite-base/14052 October 2, 2025 09:14
@graphite-app graphite-app bot force-pushed the c/09-23-feat_linter_support_disable_directives_for_type_aware_rules branch from ba4fd63 to 0dc71c1 Compare October 2, 2025 09:20
@graphite-app graphite-app bot force-pushed the graphite-base/14052 branch from 78b185a to 79eadf8 Compare October 2, 2025 09:20
@graphite-app graphite-app bot changed the base branch from graphite-base/14052 to main October 2, 2025 09:21
@graphite-app graphite-app bot force-pushed the c/09-23-feat_linter_support_disable_directives_for_type_aware_rules branch from 0dc71c1 to 8bf5013 Compare October 2, 2025 09:21
@camc314 camc314 force-pushed the c/09-23-feat_linter_support_disable_directives_for_type_aware_rules branch 2 times, most recently from f4a928e to d492f10 Compare October 2, 2025 09:57
@camc314 camc314 changed the base branch from main to graphite-base/14052 October 2, 2025 13:01
@camc314 camc314 force-pushed the c/09-23-feat_linter_support_disable_directives_for_type_aware_rules branch 16 times, most recently from c052b04 to b842366 Compare October 6, 2025 14:57
@camc314 camc314 marked this pull request as ready for review October 6, 2025 14:59
@camc314 camc314 requested a review from Sysix as a code owner October 6, 2025 14:59
@camc314 camc314 requested review from Copilot and removed request for Sysix October 6, 2025 14:59
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Oct 6, 2025
Copy link
Contributor Author

camc314 commented Oct 6, 2025

Merge activity

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements support for disable directives (like eslint-disable and oxlint-disable) for type-aware rules, addressing issue #13941. The implementation adds centralized disable directives handling that works across both regular oxc linting and type-aware tsgolint linting.

Key changes:

  • Centralized disable directives coordination through a new DirectivesStore that manages shared state between linting engines
  • Enhanced LintRunner to collect disable directives during regular linting and apply them to type-aware linting
  • Integration of disable directive checking in TsGoLintState to filter out suppressed diagnostics

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
editors/vscode/tests/code_actions.spec.ts Temporarily disabled test related to unused disable directives configuration
crates/oxc_linter/src/tsgolint.rs Added disable directives filtering for type-aware linting diagnostics
crates/oxc_linter/src/service/runtime.rs Modified to collect and store disable directives during linting
crates/oxc_linter/src/service/mod.rs Added method to set disable directives map on lint service
crates/oxc_linter/src/lint_runner.rs Added new DirectivesStore for centralized disable directives management
crates/oxc_linter/src/lib.rs Exposed disable directives utilities and modified linter to return directives
crates/oxc_linter/src/disable_directives.rs Added utility function to create unused directives diagnostics
crates/oxc_linter/src/context/host.rs Added method to extract disable directives from context host
crates/oxc_language_server/src/snapshots/* Updated test snapshots to reflect removal of fix suggestions for unused directives
crates/oxc_language_server/src/linter/* Updated language server linting to handle disable directives
apps/oxlint/src/snapshots/* Added test snapshots for disable directives with type-aware rules
apps/oxlint/src/lint.rs Modified to use new lint runner API and report unused directives
apps/oxlint/fixtures/tsgolint_disable_directives/* Added test fixtures for disable directives functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@camc314 camc314 force-pushed the c/09-23-feat_linter_support_disable_directives_for_type_aware_rules branch 2 times, most recently from b4142df to d2992b7 Compare October 6, 2025 16:56
@overlookmotel
Copy link
Member

Bravo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-editor Area - Editor and Language Server A-linter Area - Linter C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linter: disable comments are not respected by type aware rules

4 participants